/**
 * This file tests various math functions
 * 
 * */


#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <time.h>

void testSqrt(float *pole,int size){
	float result = 0.0f;
	int i;
	for (i = 0; i< size;i++){
		result = exp(pole[i]);		
	}
}

void testSqrtf(float *pole,int size){
	float result = 0.0f;
	int i;
	for (i = 0; i< size;i++){
		result = expf(pole[i]);		
	}
}


int main(){

	int imgWidth = 1024;
	int imgHeight = 768;
	int size = imgWidth * imgHeight;
	
	
	float *pole = malloc(imgWidth*imgHeight * sizeof(float));
	/* napln ho daty */
	int i;
	for (i = 0;i< size;i++){
		pole[i] = rand()/13;
	}
	
	
	clock_t start, stop;
	start = clock();
		testSqrtf(pole,size); 
	stop = clock();
	printf("sqrtf in %g seconds.\n", (stop-start));
	
	sleep(1);
	
	start = clock();
		testSqrt(pole,size); 
	stop = clock();
	printf("sqrt in %g seconds.\n", (stop-start));

	
	return 0;
}
